const mysql=require("mysql")
const dbPool={
  pool:{},
  config:{
     host:"localhost",
     user:"root",
     password:"root",
     database:"movie",
     port:"3306"     
  },
  create(){
      console.log("连接池开启")
      this.pool=mysql.createPool(this.config)
     
  } ,
  connect(sql,arr,fn){
   this.pool.getConnection((err,connection)=>{
      connection.query(sql,arr,fn)
      connection.release()   
      
   })
    


  }  
 

     
}

dbPool.create()
module.exports=dbPool